package com.aaa.system.Controller.Api;

import com.aaa.entity.RegisteredItem;
import com.aaa.system.aop.annotation.Log;
import com.aaa.system.service.RegisteredService;
import com.aaa.system.vo.RegisteredItemVo;
import com.aaa.vo.Result;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/system/api/registered")
public class ApiRegisteredController {

    @Autowired
    private RegisteredService registeredService;

    /**
     * 查询表单数据 分页  模糊
     * @param registeredItemVo
     * @return
     */
    @PostMapping("/getAllData")
    public Result<IPage<RegisteredItem>> getAllData(@RequestBody RegisteredItemVo registeredItemVo){
        return registeredService.getAllData(registeredItemVo);
    }
    /**
     * 添加/修改挂号费用信息
     */
    @PostMapping("addOrUpdRegistered")
    @Log(title = "添加/修改挂号费用信息",business_type = "1")
    public Result<Boolean> saveOrUpdRegistered(@RequestBody RegisteredItem registeredItem){
        return registeredService.saveOrUpdRegistered(registeredItem);
    }

    /**
     *删除/批量删除挂号费用信息
     */
    @DeleteMapping("delRegistered/{regItemIds}")
    @Log(title = "删除/批量删除挂号费用信息",business_type = "3")
    public Result<Boolean> delRegistered(@PathVariable Long[] regItemIds){
        return registeredService.delRegistered(regItemIds);
    }
}
